{% comment %}Get links from each sidebar, as listed in the _config.yml file under sidebars{% endcomment %}

{% for sidebar in site.sidebars %}
{% for entry in site.data.sidebars[sidebar].entries %}
{% for folder in entry.folders %}
{% for folderitem in folder.folderitems %}
{% if folderitem.url %}
{% if folderitem.url contains "html#" %}
[{{ folderitem.url | remove: "/" }}]: PageAnchorLink {{folderitem.url | remove: "/"}}
{% else %}
[{{ folderitem.url | remove: "/" | remove: ".html" }}]: {{ folderitem.url | remove: "/" }}
{% endif %}
{% endif %}
{% for subfolders in folderitem.subfolders %}
{% for subfolderitem in subfolders.subfolderitems %}
[{{subfolderitem.url | remove: "/"  | remove: ".html"}}]: {{subfolderitem.url | remove: "/"}}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
